
                   TradeWars 2002 Enhancement batch file set 
                      Kris E Lewis, 1:202/613, (c)'91-92


                                  Thanks to:

                 Programming                 Beta testing
           Joel Downer (EXE/COM's)          Justin Newton
                                             John Kegley

INTRODUCTION:
-------------
TW2002 Enhancer is a set of batch files that is meant to add some spice and
sysop convenience to TW2002, without altering ANY of the files as released.
It is highly configurable from the settings and configuration files, and as
is should require no editing to set up to your needs. If you have a problem
or question, send me netmail with your voice phone and a good time to call,
and I will assist you. Please note that I am an active duty serviceman. Our
ship's schedule may prevent my presence and your help will be delayed... 

BASIC SERVICES:
---------------
Are you tired of re-typing your registration code at BigBang time? And what
of setting all those parameters on screen G and H?  They're done for you by
this program. See the TWENH.CFG file description below for details.


ADDED GAME FEATURES:
--------------------
The Wanderer: A planet right out of TW 1000. This planet is ALWAYS registry 
# 150 and moves every time the batch is called with the maintenance option.
It can be set for any level and any defensive range. I recommend leaving it
at a level 6 (shielded).

The Death Star: A planet so heavily fortified that invasion is impossible &
even entering its sector is VERY dangerous. Recommended for beginners..NOT!
Like The Wanderer, it moves. Unlike The Wanderer, it's useless to players.

Random Planets: Completely Sysop-configurable as to what chance each planet 
has of being what level, how many, max & min, how well defended, and so on,
including what's on 'em.

Black Holes: Sectors with ways IN, but no warps leading OUT. Even TransWarp
can't help here.

Nexus: This is a VERY DEADLY trap! A Nexus is a group of seven sectors that
lead ONLY to each other. Although similar to a Black Hole, it CANNOT be de-
tected by a Density Scanner.

Crystalline Entity: Stolen directly from StarTrek: The Next Generation, has
an appetite for anything living. There will be nothing alive on a planet it
finds. Mines, Fighters & Quasar Cannons can not defend against THIS menace,
but a Shielded planet MAY be safe from attack.

Bust Evil StarShip skippers: Evil StarShip skippers have what chance of be-
ing caught? .0000 -disabled- to .9999 -absolutely- WILL get busted OR "RA",
"RE", or "RB" -Relative to Experience, Alignment, or Both. i.e.: Experience
or Alignment divided by 32000 is the chance of being caught! If RB, add Exp
to Aln and divide by 32,000 (remember that alignment is negative and exper-
ience is positive!) for the chance... Even when the chance is set to .9999,
there is *ONE* way around it... Figure it out... No, a cloak won't help! ;>
Once the the Federation Commander-in-Chief catches you, there's NO way out.

Inversion Towing Inc: A player that is trapped in a Nexus or Black Hole can
get out by calling for a tow. There are three types of tow:

  Type      Destination    Min Cost*  Max Cost
 --------   -----------    --------   --------
 Economy:    Anywhere!      50,000cr  10% of cargo, cash and ALL turns
 Safety:  an empty sector  100,000cr  50% of cargo, cash and ALL turns 
  Home:    Player decides  500,000cr  ALL of cargo, cash and turns

* these will be Sysop-configurable. Min Cost - if the player cannot meet
                                               this price, he/she is STUCK.
- also looking at EVENTUALLY being able to take "equivalent value" (mines,
  fighters, etc at rather inflated rates)                                 



SETTING UP:
---------------------------------------------------------------------------
TradeWars 2002 Enhancer depends on 4DOS 4.0. You *MUST* run 4DOS 4.0 (or up 
when available) or none of this will function, AT ALL! 

Step 1: Get and set up 4DOS 4.0 according to its instructions. If you can't
        find it, you may get it from FidoNet 1:202/613 under the magic name
        4DOS40 or download it from Trader's World! at 619-284-8729. All 1st
        time callers have sufficient access and time (2400+) to do so. Also
        note that KSTACK (part of 4DOS) MUST be loaded.
Step 2: Add the contents of TWENH*.ZIP to the directory where TW2002 itself 
        resides. They must be in the same directory, or on the path!
Step 3: Edit TWENH.CFG, MAINT.CFG, PLANET.*, BIGBANG.CFG, etc to conform to
        your wishes and system.  Read the descriptions in this file and the
        notes in the .CFGs for details.
Step 4: Modify your BBS Door control batch file to read CALL TW [game] DOOR
        instead of whatever logic is already there. TW.BAT will handle dir-
        ectory changes and such FOR you.  [game] is the Game indicator, and
        is a single character. A compressed file (compressed mode), or sub-
        directory (uncompressed mode) named 2002-[game] or [game], respect-
        ively, must exist. When TW is called with the SETUP option, it will
        be created if it doen't already exist.
Step 5: Modify/make a maintenance event during which all the maintenance is
        to happen. The command line to use to do maintenance on any game is
        CALL TW [game] MAINT (yes, it's THAT easy.)
Step 6: Create a file called LOCAL.DIF and keep it in the same directory as
        the rest of TW2002 and the enhancer. This file is a CHAIN.TXT, DOR-
        INFO1.DEF, DOOR.SYS, or whatever you made InfoType in the TWENH.CFG
        file mentioned above. This Door Info File (.DIF) is a standard file
        of its type, but must contain YOUR info (name, security level, etc)
        to use when I access TEdit.

If you wish to apply this to a game that is already Big-Banged, you may use
the SPLIT.BTM file included to create the appropriate compressed files. Use
of SPLIT is easy. Just run it in the subdirectory where the game files are.


REVISIONS:               - current              * - never released
----------
2.10 * PLANNED - Add ability for a player to ride The Wanderer. It'll cost 
        him, though!
        PROGRESS: Only an idea so far. No coding except in my head.
2.01 * PLANNED - Add Inversion Towing.
        PROGRESS: Ability to read the log for the "Help" cry is attained.
        Working on the actual "do it" routines. (about 35% basic/0% advanced)
2.00 * PLANNED - Convert entire system to "C" for speed, portability and ease-
       of-use.
        PROGRESS: Getting closer... :)

1.52  Too many folks were getting tripped by my assumption that folk'd 
       understand the aliasing needed. It's now done automatically, if Step 2 
       above is followed.
1.51 - Just a little cleaning up, and adding a variable to the Nexus routine 
1.50 - Nexus FINALLY works. I'm not gonna tell ya'll the error. I'm not 
       normally THAT stupid.
1.49 - Some bugs fixed. Don't recall what offhand. Wah. 1.48 - Random 
       number generation is now done via .COM vice .BTM. This increases 
       the execution speed CONSIDERABLY. Also squashed a planet routine bug or
       three... Sorry. the NEXUS is disabled until I find that damn cockroach!
1.47 - Cleared a couple bugs, adding the ability to catch evil starship
       captains. See section above for details.
1.46 - Grr. Another one...
1.45 - Grr. Another one that got away... Also re-wrote SPLIT to be compatible
       with 1.4x+.
1.44 - Seems I made some bugs when fixing those in 1.42. Those known are now 
       exterminated. Again, John pointed them out... Also altered the way 
       individual games' supplementary settings are handled. See notes. 
1.43 - Major bug fix. Thanks for the assist, John Kegley (105/610)!
1.42 - Yep. You guessed it. Still bored. Just cleaned up the environment usage.
1.41 * Very bored. (yes, still at sea) Made it so that TWEnh variable need not 
       be set if TW exists somewhere on the path.
1.40 * Yes, I'm at sea and bored. I've redone the entire thing to not require
       the use of other directories in compressed mode, and to run in the 
       TW dir itself in either compressed or uncompressed. This eliminates
       the need for a 2002-ANS compressed file or directory for the storage
       of static files. They're now all kept in the progam directory. If TWENH
       is used in compressed mode, then the static files are STILL stored 
       UNcompressed! This is meant as a timesaver, particularly for those who 
       have slow systems or hard drives, at least until such time as they can 
       join the 20th century.. ;)  Some of the modules (.BTMs) are are being 
       made self-supporting to be run independently of TW.BAT.
1.35 - A re-write of 1.34, essentially the same, but a bit cleaner. Added some 
       error-trapping to catch it when there's certain setup problems that 
       prevent the program from finding its config files or the needed env 
       vars are not set. Also ELIMINATED the DFilDir and GameDir variables as 
       superflous. Now, all I use is TWENH, explained above. 
1.34 * Finally fixed the Nexus routines... Forgot to take it with me to sea or 
       make it available, so 1.35 is immediately following. 
1.33 - All routines that READ data do so with a C routine now, replacing 
       GETSECT, GETGLOBE and GETPILOT BTMs with GET.EXE. This greatly speeds 
       up information routines. All data WRITES are still done with keyboard-
       faking TEdit. Clarified the installation procedure a little. Also made 
       The Wanderer and random planet Military Reaction smarter. It WAS 
       sending more fighters up OFFENSIVELY at 2:1 odds with higher defense 
       ratings. Now the higher rating causes more fighters to be DEFENSIVE, at 
       3:1 odds, which is tougher! 
1.32 - GREATLY improved the speed of the planet-entry routine. Happens so fast 
       that you can't see it now! (if ya got a REAL computer, anyway. <grin>) 
1.31 - Some diskcache programs affect display speed as they flush to the disk. 
       If yours does this (NCACHE does!), include the new parameters CACHEON 
       and CACHEOFF in TWENH.CFG. 
1.30 - Added Shield Limiting and MOVING Nexus'. Also optimized the data entry 
       routines for speed. You should not need to edit a TED line now. Also 
       drastically improved SysOp control over black holes. See README for 
       details. 
1.29 - Moved the Entity code to separate file. 
1.28 - Damn... Keep finding little (fatal!) bugs!  Squashed one that was not 
       allowing TWSector to pass its results to the calling routine. Any more? 
       Yep. Nexus creation is hosed. Gotta find it. That'll be fixed in the 
       next release (1.29 or 1.30). Moving Nexus code to its own file for ease 
       of debugging and addition of features... grrrrr...... 
1.27 - Oops. Small bug in LISTMSL that I'd not noticed. Fixed. For future 
       reference, anything to the right of the "=" in a CSET statement cannot 
       exceed 12 characters! Finished Shield Limiting as well. It's not yet 
       added to the main Batch, but is all set to go. Killed a couple more 
       bugs re: CSetLocal/CSet/CEndLocal and cleaned up the GETSECT code a 
       LOT! 
1.26 - Split ALIASES portion of README into separate file for easier 
       implementation. Added GETGLOBE (preparation for ShldLimt) 
1.25 - More bugs: a logic error that re-beaconed MSL's with MSLReBcn=N and
       a screwup in the Random planets routine. (Thanks, Justin. Never noticed
       the IF cond.. error!)
1.24 - Killed a bug or three. (where do they multiply?!?!?) 
1.23 - Separated TWFEAT into TWENH.CFG (general settings), MAINT.CFG (set-
       tings used only in Maintenance), and BIGBANG.CFG (only used in setup). 
       Did this to save environment space. No need to set stuff that's not 
       being used! 
1.22 - Added ability for use of compression algorithms other than ZIP without 
       modifying the batchfiles. Just alter TWFEAT as indicated. Killed a 
       couple more bugs and added some more commenting so folks can understand 
       more of what I'm doing! (grin) 
1.21 - Killed some bugs, added GetSect, completed Crystalline Entity code, 
       Made local play a Feature-file defined option, and added the ability to 
       handle multiple definition files for multiple games. 
1.20 - Added the [Specify] parameter to TWSector and started the code for the 
       Crystalline Entity. 
1.11 - Bug killing. Random planets were being INDICATED, but not MADE. 
1.10 - (don't recall anything prior) 


NOTES:
------

1 This system relies on 4DOS 4.0. It CANNOT run, nor be modified to run, under
  COMMAND.COM. If you do not wish to install 4DOS, though I highly recommend 
  it, you can have it set up and use the format: 4DOS/C TW [game] [action] 
  rather than CALL TW etc.

2 Read the info at the end of the major batch file and headers of the support
  ones!

3 Routines of the Enhancement package: See the headers of the .BTMs for more
--------------------------------------- information...
--------------------------------------- (JD - Joel Downer)
.BAT
TW       - Main routine

.BTM
Entity   - Handles The Crystalline Entity
ListMSL  - Creates the Major Space Lane listing and does the EXTERN maintenance
Nexus    - Creates/Moves/Removes The Nexus
Planet   - Creates a planet
Random   - Generates a psuedo-random number between 0 and 1
ShldLimt - Sets an upper limit on planetary shields
TWSector - Generates a Random Sector number with many possible conditions
Wanderer - Create/restock/moves The Wanderer
DStar    - Create/restock/moves The Death Star
Split    - Converts an already-in-play game
InvTow   - Inversion Towing  
TestVid  - Finds host system video speed for timing purposes 

.EXE/.COM
Get      - Returns info ref Sector, Pilot (player), or Globe (planet) (JD)
Put      - Writes modified data into the same areas as Get reads (JD)
Random   - Returns Random numbers reachable by the Bat. (JD)
TowMe    - Detects the request for a tow from the newspaper (JD)
            (not yet used, but available)

4 Supplementary settings files (TWENH/BIGBANG/MAINT.[game]
-------------------------------
Same information as the "main" files, but add/change settings on a "per game"
basis. Example, if --

 MAINT.CFG:                    MAINT.A:
BlackHoles=Y                  BlackHoles=N
BlackHoleDays=30
BlackHoleChance=.9999
Wanderer=Y
WRDays=8
DStar=30                      DStar=-1
DStarLitter=.3300
MSLBcn=Y                      MSLBcn=N
MSLReBcn=N
Rogues=Y
Ferrengi=Y
BBSName=Trader's World
Com=COM1
Entity=5                      Entity=2
EntityShlds=750
EntityCit=1

-- then game "A" would not have black holes or the Legion Death Star. It WOULD 
have the things not included in MAINT.A retained as stated in MAINT.CFG

